package com.unionfetch.content_home.bean

import com.unionftech.common.R.string
import com.unionftech.common.common.language.DynamicResourceManager
import java.io.Serializable

enum class TradeAccountStatus(val status: Int, val showName: String) : Serializable {
    RUNNING(1, DynamicResourceManager.getString(string.normal)),
    DISABLE(2, DynamicResourceManager.getString(string.disable)),
    READ_ONLY(3, DynamicResourceManager.getString(string.read_only)),
    FILE(4, DynamicResourceManager.getString(string.file))
}

fun Int.findAccountStatus(): TradeAccountStatus {
    for (accountStatus in TradeAccountStatus.entries) {
        if (accountStatus.status == this) {
            return accountStatus
        }
    }
    return TradeAccountStatus.RUNNING
}